#pragma once
#include"AbstractBox2DTest.h"
#include<vector>

class b2Body;

class DemoCreateFixture :public AbstractBox2DTest
{
public:
	createScene(DemoCreateFixture)
	
	CREATE_FUNC(DemoCreateFixture)

	bool init();

	virtual void box2DAppReady();

	void createShapeMap();

	b2Body* createBody(const b2Vec2& pos, std::vector<int> map);

	void work(float dt);

	void drawHeightestLine();

	b2AABB getAABBOfBody(b2Body* body);

	virtual void draw(cocos2d::Renderer *renderer, const cocos2d::Mat4& transform, uint32_t flags) override;
private:
	std::vector<std::vector<int>> shapeMapList;
	float boxSize = 16.f;
	int counter = 0;
	b2Vec2 p1;
	b2Vec2 p2;
};
